<template>
	<view class="container">
		<NavBar title="收货地址"></NavBar>
		<text class="defaultTitle">默认地址:</text>
		<AddressDefault></AddressDefault>
		<view class="listTitle">
			<text class="title">常用地址:</text>
			<text class="handle" @click="handleAddress">管理</text>
		</view>
		<view style="flex: 1">
			<AddressList ref="addressList" :handleStatus="handleStatus"></AddressList>
		</view>	
	</view>
</template>

<script>
	import AddressDefault from './components/Address-default.vue'
	import AddressList from './components/Address-list.vue'
	export default {
		components: {
			AddressDefault,
			AddressList
		},
		data() {
			return {
				handleStatus:false
			}
		},
		onShow(){
			this.$nextTick(()=>{
				this.$refs.addressList.getAddress()
			})
		},
		methods:{
			handleAddress(){
				this.handleStatus = !this.handleStatus
			}
		}
	}
</script>

<style lang="scss" scoped>
.container{
	height: 100%;
	display: flex;
	flex-direction: column;
	padding:0 20rpx;
	box-sizing: border-box;
	background: rgb(246, 246, 246);
	font-size: 28rpx;
	.defaultTitle{
		line-height: 80rpx;
		color: $u-success;
	}
	.listTitle{
		height: 80rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 1rpx dotted #d8d8d8;
		.handle{
			color:$u-success
		}
	}
}
</style>
